#ifndef TCPCLIENT_H
#define TCPCLIENT_H
#include <string>
#include <QWidget>
#include <QFile>
#include <QTcpSocket>
#include "protocol.h"
#include "opewidget.h"
QT_BEGIN_NAMESPACE

namespace Ui {
class TCPClient;
}
QT_END_NAMESPACE

class TCPClient : public QWidget
{
    Q_OBJECT

public:
    TCPClient(QWidget *parent = nullptr);
    ~TCPClient();
    void loadConfig();

    static TCPClient &getInstance();

    QTcpSocket &getTcpSocket();

public slots:
    void showConnect();
    void recvMsg();

private slots:
    //void on_send_pdu_clicked();

    void on_login_pb_clicked();

    void on_regeist_pb_clicked();

    void on_cancel_pb_clicked();

private:
    Ui::TCPClient *ui;
    QString m_strIP;
    quint16 m_usPORT;
    //连接服务器和服务器交互
    QTcpSocket m_tcpSocket;
};
#endif // TCPCLIENT_H
